<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Naver Map</title>
<script type="text/javascript"
	src="http://map.naver.com/js/naverMap.naver?key=95aacc34047b910f3f3334804fc817d7"></script>
</head>
<body style="margin: 0px;">
<div id='mapContainer' style="width: 900px; height: 500px; bgcolor: blue; border: 5px;"></div>
<div id='result'></div>
<script type="text/javascript">
<!--
var iconSize = new NSize(37, 41);
var iconOffset = new NSize(18, 41);
var iconFrom = new NIcon('http://static.naver.com/maps/ic_from.png', iconSize, iconOffset);
var iconTo = new NIcon('http://static.naver.com/maps/ic_to.png', iconSize, iconOffset);

var mapObj = new NMap(document.getElementById('mapContainer'));
mapObj.setCenterAndZoom(new NPoint(315113,544818),5);

var zoom = new NZoomControl();
zoom.setAlign("left");
zoom.setValign("bottom");
mapObj.addControl(zoom);
mapObj.addControl(new NIndexMap());

var infowin = new NInfoWindow();
mapObj.addOverlay(infowin);

function drawLine(start, end) {
	var line = new NPolyline();
	line.setWeight(20);
	line.setOpacity(0.7);
	line.setColor('#3300FF');
	line.addPoints(start, end);
	mapObj.addOverlay(line);

	var markFrom = new NMark(start, iconFrom);
	mapObj.addOverlay(markFrom);

	var markTo = new NMark(end, iconTo);
	mapObj.addOverlay(markTo);
}

function drawLineTm128(startX, startY, endX, endY) {
	drawLine(new NPoint(startX, startY), new NPoint(endX, endY));
}

function drawLineLatlng(startLat, startLng, endLat, endLng) {
	var startLatlng = new NLatLng(startLat, startLng);
	var endLatlng = new NLatLng(endLat, endLng);
	
	var startTm128 = mapObj.fromLatLngToTM128(startLatlng);
	var endTm128 = mapObj.fromLatLngToTM128(endLatlng);
	
	drawLine(startTm128, endTm128);
}

drawLineTm128(321063, 529727, 322380, 531897);
drawLineTm128(308809, 551459, 315271, 541324);

drawLineLatlng(37.3661264,127.1065984,36.430122,128.056641);

var _tm128 = mapObj.fromLatLngToTM128(new NLatLng(36.430122,128.056641));
var _latlng = mapObj.fromTM128ToLatLng(new NPoint(321063, 529727));
document.getElementById("result").innerHtml=_latlng.lat() +" " +_latlng.lng() + " / " + _tm128.x + " " + _tm128.y;


//-->
</script>
</body>
</html>
